#include<bits/stdc++.h>

using namespace std;
map<string, int> elements;

int find_r(const string &equation, int i, int num = 0){
    
    num += equation[i++]=='('?1:0;
    while(num){
        char ch = equation[i++];
        if(ch == '(')
            ++num;
        else if(ch==')')
            --num;
    }
    return --i;//返回系数
}

void deal_with_c(char c, int coe){

}

int main(){
    int n, ep, lap, cap, coefficient;
    
    string equation;
    cin >> n;
    while(n--){
        elements.clear();
        cin >> equation;        

        //分析等号左边
        ep = equation.find('=');
        lap = cap = 0;
        while(cap != ep){
            //以加号为间隔分析每个元素
            cap=equation.find('+', lap);
            coefficient = equation[lap] >='2' && equation[lap] <='9' ? equation[lap++]-'0' :1;
            while(lap<cap){
                char ch = equation[lap];
                int elep = lap;
                
            }
        }
    }
    return 0;
}